<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Counter</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .counter {
            counter-reset: counter;
            list-style: none;
            padding: 6px 12px;
        }
        .counter-item::before {
            counter-increment: counter;
            content: counters(counter,'.') ' ';
            color:rgba(0,0,0.85);
        }
    </style>
</head>
<body>
    <ul class="counter">
        <li class="counter-item">List item</li>
        <li class="counter-item">List item</li>
        <li class="counter-item">
            List item
            <ul class="counter">
                <li class="counter-item">List item</li>
                <li class="counter-item">List item</li>
                <li class="counter-item">List item</li>
            </ul>
        </li>
    </ul>
</body>
</html>